/*
 * AbstractContext.cpp
 *
 *  Created on: 21/04/2011
 *      Author: ehpalumbo
 */

#include "AbstractContext.h"

namespace contexts {


ContextUnit::ContextUnit(DataUnit& dataUnit, AbstractContext& ownerContext) {
	this->frequency = 1;
	this->dataUnit = &dataUnit;
	this->ownerContext = &ownerContext;
}

DataUnit& ContextUnit::getDataUnit() {
	return *(this->dataUnit);
}

unsigned int ContextUnit::getFrequency() {
	return this->frequency;
}

AbstractContext& ContextUnit::getOwnerContext() {
	return *(this->ownerContext);
}

void ContextUnit::updateFrequency() {
	this->frequency++;
}

ContextUnit::~ContextUnit() {
	delete this->dataUnit;
}


}
